<?php
	namespace core;
	use ReflectionClass;
	class BaseModel extends \Illuminate\Database\Eloquent\Model{
		
		//过滤不存在的字段，以免更新出错,传入参数数组
		static function filter($arr){
			$fields = self::getFields();
			$hasFields = array();
			foreach($arr as $key=>$val){
				if(in_array($key,$fields)) {
					$hasFields[$key] = $val;
				}
			}
			return $hasFields;
		}
	}